package domain;
// Generated 26-jun-2009 19:31:47 by Hibernate Tools 3.2.1.GA


import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Expense generated by hbm2java
 */
@Entity
@Table(name="expense"
    ,catalog="domeco"
)
public class Expense  implements java.io.Serializable {


     private Integer idExpense;
     private Bankaccount bankaccount;
     private String concept;
     private Date dateExpense;
     private double amount;

    public Expense() {
    }

	
    public Expense(Bankaccount bankaccount, Date dateExpense, double amount) {
        this.bankaccount = bankaccount;
        this.dateExpense = dateExpense;
        this.amount = amount;
    }
    public Expense(Bankaccount bankaccount, String concept, Date dateExpense, double amount) {
       this.bankaccount = bankaccount;
       this.concept = concept;
       this.dateExpense = dateExpense;
       this.amount = amount;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idExpense", unique=true, nullable=false)
    public Integer getIdExpense() {
        return this.idExpense;
    }
    
    public void setIdExpense(Integer idExpense) {
        this.idExpense = idExpense;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="bankFK", nullable=false)
    public Bankaccount getBankaccount() {
        return this.bankaccount;
    }
    
    public void setBankaccount(Bankaccount bankaccount) {
        this.bankaccount = bankaccount;
    }
    
    @Column(name="concept", length=250)
    public String getConcept() {
        return this.concept;
    }
    
    public void setConcept(String concept) {
        this.concept = concept;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="dateExpense", nullable=false, length=10)
    public Date getDateExpense() {
        return this.dateExpense;
    }
    
    public void setDateExpense(Date dateExpense) {
        this.dateExpense = dateExpense;
    }
    
    @Column(name="amount", nullable=false, precision=22, scale=0)
    public double getAmount() {
        return this.amount;
    }
    
    public void setAmount(double amount) {
        this.amount = amount;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idExpense != null ? idExpense.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Expense)) {
            return false;
        }
        Expense other = (Expense) object;
        if ((this.idExpense == null && other.idExpense != null) || (this.idExpense != null && !this.idExpense.equals(other.idExpense))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "domain.Expense[idExpense=" + idExpense + "]";
    }






}


